package com.okami.stream;

import java.util.Arrays;
import java.util.List;
import java.util.stream.*;

/**
 * @author: TanJingyu
 * @create: 2020-12-26 14:49
 **/
public class Test {
    public static void main(String[] args) {
        List<String> strings = Arrays.asList("1", "2");
        // flat,会把元素流自动收集成元素
        List<Integer> collect = strings.stream().flatMap(o -> Stream.of(5)).collect(Collectors.toList());
        // 不会，返回什么就是什么
        List<Stream<String>> collect1 = strings.stream().map(Stream::of).collect(Collectors.toList());

    }
}
